package edu.chen.dto.execution;

import edu.chen.enums.BasicEnum;

/**
 * 公用的结果类
 * @param <T>
 */

public class BasicExecution<T> {
    private int state;      //操作结果
    private String stateInfo;   //操作结果标识

    private T data;    //成功对象

    //租借失败
    public BasicExecution(BasicEnum basicEnum) {
        this.state = basicEnum.getState();
        this.stateInfo = basicEnum.getStateInfo();
    }

    public BasicExecution(BasicEnum basicEnum, T data) {
        this.state = basicEnum.getState();
        this.stateInfo = basicEnum.getStateInfo();
        this.data = data;
    }
    public int getState() {
        return state;
    }
    public String getStateInfo() {
        return stateInfo;
    }

    public T getData() {
        return data;
    }
}
